home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / Script Runner• / Script Runner•.rsrc / dFRK_5063 < prev    next >
Encoding:
Text File  |  1995-12-12  |  2.1 KB  |  91 lines

  1. /*------------------------------------------------------------------------------
  2.     File:        ScriptRunnerInit.cpp
  3.  
  4.     Contains:    Init routines
  5.  
  6.     Written by:    Sue Dumont
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. ------------------------------------------------------------------------------*/
  10.  
  11. // -- Compiler/Preprocessor Switches --
  12.  
  13. #ifndef _COMPILERDEFS_
  14. #include "CompDefs.h"
  15. #endif
  16.  
  17. // -- OpenDoc Utilities --
  18.  
  19. #ifndef _EXCEPT_
  20. // Exceptions define several important macros (ie. CHECKENV)
  21. // which are used in the SOM method dispatch glue. If Except.h
  22. // is not included early enough, exceptions may not be thrown
  23. // correctly when returning from a SOM method with "ev" parameter set.
  24. #include <Except.h>
  25. #endif
  26.  
  27. // -- SOM Includes --
  28.  
  29. #ifndef som_xh
  30. #include <som.xh>
  31. #endif
  32.  
  33. #ifndef SOM_SOMObject_xh
  34. #include <somobj.xh>
  35. #endif
  36.  
  37. // -- ScriptRunner Includes --
  38.  
  39. #ifndef SOM_SampleCode_ScriptRunner_xh
  40. #include "ScriptRunner.xh"
  41. #endif
  42.  
  43. // -- OpenDoc Utilities --
  44.  
  45. #ifndef __USERSRCM__
  46. #include <UseRsrcM.h>
  47. #endif
  48.  
  49. #ifndef _ODMEMORY_
  50. #include <ODMemory.h>
  51. #endif
  52.  
  53. // -- MacToolbox Includes --
  54.  
  55. #ifndef __CODEFRAGMENTS__
  56. #include <CodeFragments.h>
  57. #endif
  58.  
  59. /*
  60. #ifdef applec
  61. #pragma segment ScriptRunnerInit
  62. #endif
  63. */
  64.  
  65. #pragma segment ScriptRunnerInit
  66.  
  67. //------------------------------------------------------------------------------
  68. // Prototypes
  69. //------------------------------------------------------------------------------
  70.  
  71. extern "C" pascal OSErr ScriptRunnerCFMInit(CFragInitBlockPtr initBlkPtr);
  72.  
  73.  
  74. //------------------------------------------------------------------------------
  75. // Functions
  76. //------------------------------------------------------------------------------
  77.  
  78. extern "C" pascal OSErr ScriptRunnerCFMInit(CFragInitBlockPtr initBlkPtr)
  79. {
  80.     // We are using OpenDoc's memory management calls, so we
  81.     // must initialize the interface to the memory manager.
  82.     OSErr err1 = InitODMemory();
  83.  
  84.     // We must also capture the relevant information about
  85.     // our library file so that we may access our resources.
  86.  
  87.     OSErr err2 = InitLibraryResources(initBlkPtr);
  88.     
  89.     return (OSErr) (err1 != noErr) ? err1 : err2;
  90. }
  91.